<html>
<title>新用户注册</title>
<style>
    html {
        margin: 0;
        padding: 0;
        width: 100%;
        height: 100%;
        background-repeat: no-repeat;
        /* background-color: #66dce0; */
    }

    input {
        margin-top: 20px;
        border-radius: 3px;
        border: none;
    }
</style>
<div>
    <form style="background-image: linear-gradient(to top, #479ed3 0%, #72f8c2 100%);
        width: 300px;height: 400px; color: aliceblue; text-align: center; border-radius: 5px;
        margin: 0 auto; margin-top: 50px;
        ">
        <label for="sn">学号：</label>
        <input type="text" name="sn" id="sn">
        <br>
        <label for="pswd">密码：</label>
        <input type="password" name="pswd" id="pswd">
        <br>
        <label for="repswd">确认密码：</label>
        <input type="password" name="repswd" id="repswd">

        <br>
        <label for="sn">性别：</label>
        <input type="text" name="sex" id="sex">
        <br>
        <label for="sn">真实姓名：</label>
        <input type="text" name="realName" id="realName">
        <br>
       
        <input type="button" onclick="register()" value="提交">
        <input type="reset" value="重置">
        <br>
    </form>
</div>
<script>

    function register() {
        var userinfo = new Object();
        userinfo.Sn = document.getElementById("sn").value;
        userinfo.Pswd = document.getElementById("pswd").value;
        userinfo.Repswd = document.getElementById("repswd").value;
        userinfo.Sex = document.getElementById("sex").value;
        userinfo.RealName = document.getElementById("realName").value;
        userinfo.Email = document.getElementById("email").value;
        userinfo.Tel = document.getElementById("tel").value;
        userinfo.Address = document.getElementById("address").value;
        if (userinfo.Pswd != userinfo.Repswd) {
            alert("您输入的两次密码不一致，请检查");
            return
        }
        fetch("/doRegister",{
            method:'post',
            body:JSON.stringify(userinfo)
        }).then( alert("注册成功"))
    }


</script>

</html>